<!--
  Copyright © 2015 Cask Data, Inc.

  Licensed under the Apache License, Version 2.0 (the "License"); you may not
  use this file except in compliance with the License. You may obtain a copy of
  the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  License for the specific language governing permissions and limitations under
  the License.
-->

<div ng-hide="welcomeIsHidden">
  <div class="panel panel-message">
    <div class="panel-heading clearfix">
      <h3>
        Welcome CDAP Admin
      </h3>
    </div>
    <div class="panel-body">
      <p>This is the control console for CDAP. Here, you can manage your system configuration, namespaces, and entities.
         Begin by configuring your default namespace.</p>
    </div>
  </div>
</div>

<div>

  <div class="row">
    <div class="col-xs-6">
      <h3>Namespaces</h3>
    </div>
    <div class="col-xs-6 text-right h3">
      <a ui-sref="admin.namespace.create" class="btn btn-default"><span class="fa fa-plus"></span> Add Namespace</a>
    </div>
  </div>
  <div class="table-responsive">
    <table class="table table-curved namespace-table" cask-sortable>
        <thead>
          <tr ng-class="{'sort-enabled': nsList.length>0}">
            <th data-predicate="name">Name</th>
            <th data-predicate="appsCount">Applications</th>
            <th data-predicate="datasetsCount">Datasets</th>
            <th data-predicate="streamsCount">Streams</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="namespace in nsList | orderBy:sortable.predicate:sortable.reverse">
            <td>
              <div>
                {{ ::namespace.name }}
              </div>
            </td>
            <td>
              <span ng-bind="namespace.appsCount"></span>
            </td>
            <td>
              <span ng-bind="namespace.datasetsCount"></span>
            </td>
            <td>
              <span ng-bind="namespace.streamsCount"></span>
            </td>
          </tr>
        </tbody>
    </table>
  </div>
</div>
